package co.fitstart.admin.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.demo2do.core.support.Page;

import co.fitstart.admin.entity.content.ExpiryScheduleSearch;
import co.fitstart.admin.entity.report.CoachFinishedSchedule;
import co.fitstart.admin.entity.security.Login;
import co.fitstart.entity.course.round.CourseRound;
import co.fitstart.entity.course.schedule.CourseSchedule;
import co.fitstart.entity.course.schedule.ScheduleStatus;
import co.fitstart.entity.principal.Principal;
import co.fitstart.entity.site.RoomType;
import co.fitstart.entity.site.Site;

/**
 * 
 * @author mohanlan
 *
 */
public interface CourseScheduleService extends DataService<CourseSchedule> {
    
    /**
     * 
     * @param site
     * @param scheduleStatus
     * @param dates
     * @return
     */
    public List<CourseSchedule> list(Site site, ScheduleStatus scheduleStatus, List<Date> dates);
    
    /**
     * 
     * @param sites
     * @param scheduleStatus
     * @param dates
     * @return
     */
    public List<CourseSchedule> list(List<Site> sites, ScheduleStatus scheduleStatus, List<Date> dates);
    
    /**
     * 
     * @param site
     * @return
     */
    public Map<String, List<CourseSchedule>> list(Site site);
    
    /**
     * 
     * @param site
     * @param coach
     * @param beginDate
     * @param endDate
     * @return
     */
    public List<CourseSchedule> listCourseSchedule(Site site, Principal coach, Date beginDate, Date endDate);
    
    /**
     * 
     * @param sites
     * @param coach
     * @param beginDate
     * @param endDate
     * @return
     */
    public List<CourseSchedule> listCourseSchedule(List<Site> sites, Principal coach, Date beginDate, Date endDate);
    
    /**
     * 
     * @param courseRounds
     * @param dayhour
     * @return
     */
    public List<CourseSchedule> listCourseSchedule(List<CourseRound> courseRounds, String dayhour);
    
    /**
     * 
     * @param site
     * @param date
     * @param period
     * @param page
     * @return
     */
    public List<CourseSchedule> listFinishedSchedule(Site site, Date date, String period, Page page);
    
    /**
     * 
     * @param sites
     * @param date
     * @param period
     * @param page
     * @return
     */
    public List<CourseSchedule> listFinishedSchedule(List<Site> sites, Date date, String period, Page page);
    
    /**
     * 
     * @param site
     * @param date
     * @param period
     * @param page
     * @return
     */
    public List<CoachFinishedSchedule> listCoachFinishedSchedule(Site site, Date date, String period, Page page);
    
    /**
     * 
     * @param sites
     * @param date
     * @param period
     * @param page
     * @return
     */
    public List<CoachFinishedSchedule> listCoachFinishedSchedule(List<Site> sites, Date date, String period, Page page);

    /**
     * 
     * @param coach
     * @param day
     * @return
     */
    public List<CourseSchedule> listExperienceSchedule(Principal coach, Date day);
    
    
    /**
     * 
     * @param courseSchedule
     */
    public void changeTime(CourseSchedule courseSchedule);
    
    /**
     * 
     * @param courseSchedule
     * @param coach
     */
    public void changeCoach(CourseSchedule courseSchedule, Principal coach);
    
    /**
     * 
     * @param courseSchedule
     * @param coach
     * @param day
     * @param hour
     */
    public void editSchedule(CourseSchedule courseSchedule, Principal coach, Site site, Date day, String hour);
    
    /**
     * 
     * @param courseRound
     * @param amount
     */
    public void addSchedule(CourseRound courseRound, int amount);
    
    /**
     * 
     * @param courseRound
     * @param courseSchedule
     * @param roomType
     */
    public void addSchedule(CourseRound courseRound, CourseSchedule courseSchedule, RoomType roomType);
    
    /**
     * 
     * @param courseRound
     * @param amount 
     * @param beginDate
     * @param dayhours
     * @return
     */
    public List<String> calculateDayhour(CourseRound courseRound, int amount, Date beginDate, String ... dayhours);
    
    /**
     * 
     * @param courseSchedule
     * @param site
     * @param coach
     * @param occurDate
     * @param occurHour
     */
    public void rearrange(CourseSchedule courseSchedule, Site site, Principal coach,  Date occurDate, String occurHour);
    
    /**
     * 
     * @param login
     * @param coach
     * @param courseSchedule
     */
    public void finish(Login login, Principal coach, CourseSchedule courseSchedule);
    
    /**
     * 
     * @param courseSchedule
     */
    public void cancel(CourseSchedule courseSchedule);
    
    /**
     * 
     * @param expriyScheduleSearch
     */
    public List<CourseSchedule> expirySearch(ExpiryScheduleSearch expiryScheduleSearch);
    
    /**
     * @author Chang Liu
     * 
     * @param site
     * @param date
     * @param hour
     * @return
     */
    public List<Principal> getAvailableScheduleCoach(Site site, Date day, String hour, List<Principal> coaches);
    
    /**
     * 
     * @param coach
     * @param date
     * @param hour
     */
    public void validateCoachTime(Principal coach, Date date, String hour);
    
    /**
     * 
     * @param mobile
     * @param date
     * @param hour
     */
    public void validateStudentTime(String mobile, Date date, String hour);
    
    /**
     * 
     * @param coachId
     * @param date
     * @param site
     * @return
     */
    public List<Map<String, String>> listAvailableExperienceHour(Long coachId, Date date, Site site);
    
    /**
     * 
     * @param site
     * @param day
     * @param hour
     * @param experience
     * @return
     */
    public RoomType getAvailableRoomType(Site site, Date day, String hour, boolean experience);
    
    /**
     * 
     * @param site
     * @param day
     * @param hour
     * @param experience
     * @param courseSchedule
     * @return
     */
    public RoomType getAvailableRoomType(Site site, Date day, String hour, boolean experience, CourseSchedule courseSchedule);
    
    /**
     * 
     * @return
     */
    public List<Principal> getAllCoachs();
    
    /**
     * LZJ
     * @param site
     * @return
     */
    public List<Principal> getSiteCoachs(Site site);
}
